<template>
  <div class="checkSign">
    <div class="header_body">
      <header-nav :leftArrow="true" titelText="签名"></header-nav>
    </div>

    <div class="signature">
      <van-image v-if="sign" :src="sign" />
      <van-signature v-else @submit="onSubmit" @clear="onClear" />
    </div>
  </div>
</template>
<script setup>
const router = useRouter()
const sign = ref('')

const onSubmit = (data) => {
  sign.value = data.image
  router.back()
}
const onClear = () => {}

onMounted(() => {
  sign.value = ''
})
</script>
<style scoped lang="scss">
/* CSS样式 */
.checkSign {
  perspective: 800px; /* 设置视角深度 */
  overflow: hidden; /* 限制内容超出边界不显示 */

  .signature {
    // width: 100%;
    height: 100%;
    margin-top: 46px;
  }
}
</style>
